Skip to content

Add audience_ids to AI External Pages API (Preview)#516

Open
alexpetrash-code wants to merge 4 commits into
mainfrom
alexpetrash/external-pages-audience-ids
Open

Add audience_ids to AI External Pages API (Preview)#516
alexpetrash-code wants to merge 4 commits into
mainfrom
alexpetrash/external-pages-audience-ids

Conversation

@alexpetrash-code
Copy link
Copy Markdown
Contributor

Why?

Customers integrating with the AI External Pages API now need to read and set Fin AI Agent audience targeting on external pages programmatically. The behavior shipped in the monolith over three PRs but the OpenAPI spec has not been updated — generated SDKs and Postman collections do not surface the field, and developer-docs cannot be synced until this lands.

How?

Document audience_ids as a nullable array of integers on the external_page response schema and on both write request schemas. The field is gated by the AddAudienceIdsToExternalPages change registered in UnstableVersion, so it is Preview-only.

Monolith PRs being documented:

External pages have a unique inheritance dimension because they belong to a parent content import source that can carry default audience segments:

  • POST — omitting audience_ids preserves any defaults inherited from the parent import source. An explicit array overrides those defaults. [] clears all targeting (even when the source has defaults).
  • PUT — PATCH semantics matching the other knowledge-API write endpoints. Omitting leaves memberships intact; [] clears; an explicit array replaces.

Unknown audience IDs return 404 with no partial commit. A companion developer-docs PR with the matching schema additions will follow (changelog entry intentionally deferred — will be folded into a single follow-up PR covering all knowledge content types).

sent by alexbot

Documents the audience_ids field added to the AI External Pages API in:
- intercom/intercom#512971 (GET — read support)
- intercom/intercom#513583 (POST — write support on create/upsert)
- intercom/intercom#513451 (PUT — write support on update)

Adds the field to:
- external_page schema (response)
- create_external_page_request
- update_external_page_request

POST has special inheritance semantics: omitting audience_ids preserves
defaults inherited from the parent content_import_source; an explicit
array overrides them; [] clears all targeting. PUT uses PATCH semantics
matching the other knowledge-API write endpoints.

Gated by the AddAudienceIdsToExternalPages version change in
UnstableVersion (Preview-only).

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@alexpetrash-code alexpetrash-code self-assigned this May 22, 2026
alexpetrash-code and others added 3 commits May 22, 2026 16:43
Mirrors the fixes applied to the developer-docs companion PR
intercom/developer-docs#930. Per Redocly bot + Ivan's review pattern
on the sibling PRs:

1. Add `audience_ids: [1, 2]` to inline examples on listExternalPages,
   createExternalPage (request + response), getExternalPage,
   updateExternalPage (request + response).

2. Add a 404 response to POST /ai/external_pages for the new "unknown
   audience IDs" error case (returns invalid_parameter code).

3. Add a 404 response to PUT /ai/external_pages/{id} for the same case
   (this endpoint had no 404 documented previously).
The Ruby constant `Api::V3::Errors::Code::INVALID_PARAMETER` maps to the
string `'parameter_invalid'`, not `'invalid_parameter'`. The serializer
in error_handler.rb#error_to_hash renders the constant's value as the
JSON `code` field, so the actual API response is:

    code: parameter_invalid

not `invalid_parameter` as previously documented. HTTP 404 status was
correct; only the code string was wrong.
DELETE returns the full external_page schema, so the inline response example should mirror the new audience_ids field.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@alexpetrash-code alexpetrash-code enabled auto-merge (squash) May 22, 2026 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant